package com.Service.Impl;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.Dao.BaseDaoI;
import com.Entity.Userdata;
import com.Service.UserdataService;
@Service("userdataservice")
public class UserdataServiceImpl extends BaseServiceImpl<Userdata> implements UserdataService {
		@Autowired
		private BaseDaoI<Userdata> userdatadao;

		public void updatePregnancyDate(Date pregnancydate, int userid) {

			Map<String, Object> params = new HashMap<String, Object>();
			params.put("pregnancyDate", pregnancydate);
			params.put("userid", userid);
			String hql = "update Userdata t set t.pregnancyDate = :pregnancyDate where t.userId = :userid";
			userdatadao.executeHql(hql,params);
		}
		
		public void updateExpectedDateBirth(Date expecteddateBirth, int userid) {

			Map<String, Object> params = new HashMap<String, Object>();
			params.put("expectedDateBirth", expecteddateBirth);
			params.put("userid", userid);
			String hql = "update Userdata t set t.expectedDateBirth = :expectedDateBirth where t.userId = :userid";
			userdatadao.executeHql(hql,params);
		}


}
